import request from '@/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/blade-system/workspace/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
export const getDetail = (id) => {
  return request({
    url: '/blade-system/workspace/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/blade-system/workspace/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/blade-system/workspace/save',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/blade-system/workspace/update',
    method: 'post',
    data: row
  })
}

export const getWorkUserList = (current, size, params, workspaceId) => {
  return request({
    url: '/blade-user/workuser',
    method: 'get',
    params: {
      ...params,
      current,
      size,
      workspaceId
    }
  })
}

export const addWorkUser = (userid,workspaceid) => {
  return request({
    url: '/blade-system/workspace/addWorkUser',
    method: 'post',
    params: {
      userid,
      workspaceid
    }
  })
}
export const removeWorkUser = (ids,workspaceid) => {
  return request({
    url: '/blade-system/workspace/removeWorkUser',
    method: 'post',
    params: {
      ids,
      workspaceid
    }
  })
}
